package com.iam.api.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.iam.api.service.SysCompanyService;
import com.iam.api.service.SysDictDataService;
import com.iam.core.base.BaseCommonController;
import com.iam.core.entities.Result;
import com.iam.core.model.SysCompany;
import com.iam.core.model.SysDictData;
import com.iam.core.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/api/sysDictData")
public class SysDictDataController extends BaseCommonController<SysDictData> {


    @Autowired
    private SysDictDataService<SysDictData> service;

    /**
     * 获取service
     */
    @Override
    public SysDictDataService<SysDictData> getiService() {
        return service;
    }

    @GetMapping("/listByCode/{code}")
    public Result listByCode(@PathVariable String code) {
        return ResultUtil.success(service.list(new QueryWrapper<SysDictData>().eq("code", code)));
    }

    /**
     * 获取模块名称
     */
    @Override
    public String getMouduleName() {
        return "字典类型";
    }

}